package org.hackystat.ui.projectviewer.gwt.testsuite;

import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.net.ConnectException;
import java.net.InetAddress;
import java.net.Socket;

public class GWTTestHelperClient {

  public static void main(String[] args) {

    try {
      InetAddress Server_IP = InetAddress.getByName(null);
      // create a socket
      Socket clientSock = new Socket(Server_IP, 9000);
      BufferedWriter out = new BufferedWriter(new OutputStreamWriter(clientSock.getOutputStream()));
      // send a message
      out.write("stop");
      out.flush();
      clientSock.shutdownOutput();
      // close the socket
      clientSock.close();
    }
    catch (ConnectException e) {
      System.out.println("Socket-Client:" + e);
      e.printStackTrace();
    }
    catch (IOException e) {
      System.out.println("Socket-Client: " + e);
      e.printStackTrace();
    }
  }
}